﻿using System.Reflection;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace DetectWebApi.Models.DamageBuilding
{
    /// <summary>
    /// 损伤细节文档
    /// </summary>
    public class DamagedDetailDocument
    {

        /// <summary>
        /// 总结ID
        /// </summary>
        [BsonElement("SummaryId")]
        [BsonRepresentation(BsonType.ObjectId)]
        public ObjectId SummaryId
        {
            set;
            get;
        }

        /// <summary>
        /// 损伤类型ID
        /// </summary>
        [BsonElement("DamageTypeId")]
        [BsonRepresentation(BsonType.ObjectId)]
        public ObjectId DamageTypeId { set; get; }

        /// <summary>
        /// 损伤名称
        /// </summary>
        [BsonElement("DamageName")]
        [BsonRepresentation(BsonType.String)]
        public string DamageName { set; get; }

        /// <summary>
        /// 损伤值
        /// </summary>
        [BsonElement("DamageValue")]
        public double DamageValue { set; get; }

        /// <summary>
        /// 损伤部位
        /// </summary>
        [BsonElement("DamagePart")]
        [BsonRepresentation(BsonType.String)]
        public string DamagePart { set; get; }

        /// <summary>
        /// 损伤描述
        /// </summary>
        [BsonElement("DamageDescr")]
        [BsonRepresentation(BsonType.String)]
        public string DamageDesc { set; get; }

        /// <summary>
        /// 损伤形态图片地址
        /// </summary>
        [BsonElement("DamageFormImgUrl")]
        [BsonRepresentation(BsonType.String)]
        public string DamageFormImgUrl { set; get; }

        public DamagedDetailDocument(ObjectId summaryId,ObjectId damageTypeId,string damageName,string damagePart,double damageValue, string formImgUrl, string damageDesc = "NULL")
        {
            this.SummaryId = summaryId;
            this.DamageTypeId = damageTypeId;
            this.DamageName = damageName;
            this.DamagePart = damagePart;
            this.DamageValue = damageValue;
            this.DamageDesc = damageDesc;
            this.DamageFormImgUrl = formImgUrl;
        }

    }
}
